import request from '@/router/axios';

/**
 * @param params 查询 顶部菜单列表
 * */
export const getList = (params) => {
    return request({
        url: '/api/user-api/mx-menu-classification/list',
        method: 'get',
        params: params
    })
}

/**
 * @param data 添加 顶部菜单
 * */
export const save = (data) => {
    return request({
        url: '/api/user-api/mx-menu-classification/insert',
        method: 'post',
        data: data
    })
}

/**
 * @param data 修改 顶部菜单
 * */
export const update = (data) => {
    return request({
        url: '/api/user-api/mx-menu-classification/update',
        method: 'post',
        data: data
    })
}

/**
 * @param params 查看 顶部菜单
 * */
export const getDetail = (params) => {
    return request({
        url: '/api/user-api/mx-menu-classification/detail',
        method: 'get',
        params: params
    })
}

/**
 * @param params 删除 顶部菜单
 * */
export const del = (params) => {
    return request({
        url: '/api/user-api/mx-menu-classification/delete',
        method: 'post',
        params: {oids:params.ids}
    })
}

/**
 * @param id 获取 顶部菜单子菜单
 * */
export const getTopMenu = (id) => {
    return request({
        url: '/api/user-api/mx-menu/getMenuListByUser?pid=' + id,
        method: 'get',
    })
}
